package com.tuvi.nhamthin.activity;

import com.tuvi.nhamthin.R;
import com.tuvi.nhamthin.services.BackgroundMusic;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageButton;

public class AgeDetail extends BaseActivity {

	private WebView mWebView;
	 /** Button Back */
    private ImageButton mBtnBack;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.age_detail);
		Intent intent = getIntent();
		String htmlName = intent.getStringExtra("htmlName");		
	    mWebView = (WebView) findViewById(R.id.webview);
	    mWebView.getSettings().setJavaScriptEnabled(true);
	    mWebView.loadUrl("file:///android_asset/" + htmlName +".html");
	    mWebView.setWebViewClient(new HelloWebViewClient());
	    mBtnBack = (ImageButton) findViewById(R.id.btn_back);
	    mBtnBack.setOnClickListener(new OnClickListener() {
	    	    public void onClick(View v) {
	    	       // your code here
	    	    	finish();
	    	    }
	    	});

	}
	
	private class HelloWebViewClient extends WebViewClient {
	    @Override
	    public boolean shouldOverrideUrlLoading(WebView view, String url) {
	        view.loadUrl(url);
	        return true;
	    }
	}
    @Override
    public void onStop(){
    	super.onStop();
    }
    @Override
    public void onResume(){
    	super.onResume();
    }
}


